/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

{% set cases = [
    {
        'description' : '0. Export default is not allowed to export multiple specifiers.',
        'data': ['class C {}','class D {}'],
        'export_ex': ['default {C, type D}'],
        'tags': 'compile-only, negative'
    },{
        'description' : '1. Default Multiple Export type. Expect error.',
        'data': ['class C {}','class D {}'],
        'export_ex': ['default type {C, D}'],
        'tags': 'compile-only, negative'
    },{
        'description' : '2. Only one default export is allowed in a module.',
        'data': ['class D {}'],
        'export_ex': ['default type N = D', 'default type S = D'],
        'tags': 'compile-only, negative'
    },{
        'description' : '3. Duplicated export type. Class. With AS. Expect warning.',
        'data': ['class D {}'],
        'export_ex': ['type {D, D as F}'],
        'tags': 'compile-only'
    },{
        'description' : '4. Duplicated export type. Class. Expect warning.',
        'data': ['class D {}'],
        'export_ex': ['type {D, D}'],
        'tags': 'compile-only'
    },{
        'description' : '5. Duplicated export type. Class. Expect warning.',
        'data': ['class D {}'],
        'export_ex': ['type {D}', 'type {D}'],
        'tags': 'compile-only'
    },{
        'description' : '6. Repited Export type. Class.',
        'data': ['class D {}'],
        'export_ex': ['type S = D', 'type A = D'],
        'tags': 'compile-only'
    },{
        'description' : '7. Duplicated export type. Constants. Expect warning.',
        'data': ['const NUM: int = 11'],
        'export_ex': ['type {NUM}', 'type {NUM}'],
        'tags': 'compile-only'
    },{
        'description' : '8. Duplicated export type. Constants. Expect warning.',
        'data': ['const NUM: int = 786'],
        'export_ex': ['type {NUM, NUM}'],
        'tags': 'compile-only'
    },{
        'description' : '9. Duplicated export type. Constants. With AS. Expect warning.',
        'data': ['const NUM: int = 445'],
        'export_ex': ['type {NUM, NUM as V}'],
        'tags': 'compile-only'
    },{
        'description' : '10. Duplicated export type. Class. With AS DEFAULT. Expect warning.',
        'data': ['class D {}'],
        'export_ex': ['type {D, D as default}'],
        'tags': 'compile-only'
    }
 ] %}

{%- macro generate_complete_test()%}
{% for c in cases %}

 /*---
desc: {{c.description}}
tags: [{{c.tags}}]
---*/

{%- for dt in c.data%}
{{dt}}
{%- endfor %}

{%- for exp_e in c.export_ex %}
export {{exp_e}}
{%- endfor %}

{%- endfor %}
{%- endmacro %}
